package cc.eddic.examinationsystem.dto;

import cc.eddic.examinationsystem.domain.Student;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class StudentModel {
    private Long id;
    private Long employeeNo;
    private String name;
    private Integer gender;
    private String email;
    private String mobile;
    private Integer version;
    private String password;

    public static StudentModel from(Student student) {
        StudentModel studentModel = new StudentModel();
        BeanUtils.copyProperties(student, studentModel);
        return studentModel;
    }
}
